package a.f.h.f.a;

import a.c.*;
import a.c.d;
import a.c.m;
import a.f.j.cb;
import a.f.j.o;
import a.f.j.p;
import a.i.t;

import java.util.ArrayList;
import java.util.List;

public class n
  extends cb
{
  public static final double s = 100.0D;
  private x t;
  private cb u;
  private q v;
  private a.c.n w;
  private p x;
  private p y;
  private p z;
  private a.c.n A;
  private List B;
  private List C;
  private final x D;
  private e E;
  private a.c.n F = null;
  private a.c.n G = null;
  protected int H = 0;
  public static boolean I;
  
  public n(cb paramcb, e parame)
  {
    super(new q());
    this.u = paramcb;
    this.v = this.u.a();
    this.E = parame;
    this.t = this.v.B();
    this.B = new ArrayList();
    this.C = new ArrayList();
    this.D = super.a().B();
    this.w = super.a().C();
    this.x = this.u.g();
    this.z = this.u.g();
    this.A = super.a().C();
  }
  
  public void a(a.c.n paramn)
  {
    this.F = paramn;
  }
  
  public void c(a.c.n paramn)
  {
    this.G = paramn;
  }
  
  public void a(d paramd, ab paramab)
  {
    int i6 = e.i;
    boolean bool = e.h;
    q localq = super.a();
    paramab.add(paramd);
    Object localObject1 = paramab.l();
    do
    {
      if (!((m)localObject1).e()) {
        break;
      }
      this.v.g(((m)localObject1).a());
      if (i6 != 0) {
        break label94;
      }
      ((m)localObject1).f();
      if (bool) {
        break label90;
      }
    } while (!bool);
    if (i6 == 0)
    {
      this.H = a(this.t);
      label90:
      label94:
      localObject1 = paramab.l();
      if (((m)localObject1).e()) {}
      while (i6 != 0)
      {
        if (i6 != 0) {
          break label162;
        }
        this.v.f(((m)localObject1).a());
        ((m)localObject1).f();
        if (bool) {
          break label158;
        }
        if (!bool) {
          break;
        }
      }
    }
    this.y = this.u.g();
    label158:
    label162:
    localObject1 = this.u.b();
    Object localObject2;
    int k;
    Object localObject6;
    label309:
    Object localObject4;
    label554:
    label556:
    label563:
    do
    {
      do
      {
        if (!((o)localObject1).e()) {
          break;
        }
        localObject2 = ((o)localObject1).a();
        int j = 2147483647;
        if (i6 != 0) {
          break label604;
        }
        k = 0;
        if (bool) {
          break label594;
        }
        m localm2 = ((a.f.j.n)localObject2).a();
        Object localObject5;
        do
        {
          if (!localm2.e()) {
            break;
          }
          localObject5 = localm2.a();
          localObject6 = ((d)localObject5).e();
          a.c.e locale = ((d)localObject5).f();
          j = Math.min(j, l((a.c.e)localObject6));
          k = Math.max(k, l(locale));
          localm2.f();
          if ((i6 == 0) && (bool)) {
            break label309;
          }
        } while (!bool);
        if (i6 != 0) {
          break label563;
        }
        this.y.a((a.f.j.n)localObject2, j);
        if (localObject2 == this.u.c())
        {
          int m = 0;
          while (m < k - j)
          {
            localObject5 = localq.i();
            this.B.add(localObject5);
            this.D.a(localObject5, "LO" + (j + m));
            localObject6 = localq.i();
            this.C.add(localObject6);
            this.D.a(localObject6, "RO" + (j + m));
            m++;
            if ((i6 != 0) || (i6 != 0)) {
              break label556;
            }
            if (bool) {
              break label554;
            }
          }
        }
        localObject4 = new ArrayList(k - j);
        int n = 0;
        do
        {
          if (n >= k - j) {
            break;
          }
          localObject6 = localq.i();
          this.D.a(localObject6, j + n);
          ((ArrayList)localObject4).add(localObject6);
          n++;
          if (i6 != 0) {
            break label556;
          }
          if (bool) {
            break label554;
          }
        } while (!bool);
        if (i6 != 0) {
          break label618;
        }
        a((a.f.j.n)localObject2, (List)localObject4);
        ((o)localObject1).f();
      } while (!bool);
    } while (i6 != 0);
    localObject1 = this.u.b();
    label594:
    label604:
    label618:
    Object localObject3;
    label707:
    label709:
    do
    {
      do
      {
        if (!((o)localObject1).e()) {
          break label712;
        }
        localObject2 = ((o)localObject1).a();
        if (bool) {
          break label713;
        }
        if (!localObject2.equals(this.u.c()))
        {
          localObject3 = e((a.f.j.n)localObject2);
          k = 1;
          do
          {
            if (k >= ((List)localObject3).size()) {
              break;
            }
            localObject4 = localq.a((a.c.e)((List)localObject3).get(k - 1), (a.c.e)((List)localObject3).get(k));
            a((d)localObject4, 0.0D);
            k++;
            if (i6 != 0) {
              break label709;
            }
            if (bool) {
              break label707;
            }
          } while (!bool);
        }
      } while (i6 != 0);
      ((o)localObject1).f();
    } while (!bool);
    label712:
    label713:
    int i = 1;
    do
    {
      do
      {
        if (i >= this.B.size()) {
          break;
        }
        localObject2 = localq.a((a.c.e)this.B.get(i - 1), (a.c.e)this.B.get(i));
        a((d)localObject2, 0.0D);
        i++;
        if (i6 != 0) {
          break label800;
        }
        if (bool) {
          break label798;
        }
      } while (!bool);
    } while (i6 != 0);
    i = 1;
    label798:
    label800:
    do
    {
      if (i >= this.C.size()) {
        break;
      }
      if (i6 != 0) {
        break label877;
      }
      localObject2 = localq.a((a.c.e)this.C.get(i - 1), (a.c.e)this.C.get(i));
      if (bool) {
        break label874;
      }
      a((d)localObject2, 0.0D);
      i++;
    } while (!bool);
    label874:
    label877:
    m localm1 = this.v.w();
    label1198:
    label1259:
    label1267:
    do
    {
      if (!localm1.e()) {
        break;
      }
      localObject2 = localm1.a();
      localObject3 = this.u.b(localm1.a());
      a.f.j.n localn = this.u.c((d)localObject2);
      localObject4 = this.u.c((d)localObject3);
      List localList = u((d)localObject2);
      localObject6 = u((d)localObject3);
      if (bool) {
        return;
      }
      if (i6 == 0) {
        if (localList == null) {
          localList = this.B;
        }
      }
      if ((i6 != 0) || (localObject6 == null)) {
        localObject6 = this.C;
      }
      int i1 = this.y.getInt(localn);
      int i2 = this.y.getInt(localObject4);
      int i3 = Math.min(this.t.getInt(((d)localObject2).e()), this.t.getInt(((d)localObject2).f()));
      int i4 = Math.max(this.t.getInt(((d)localObject2).e()), this.t.getInt(((d)localObject2).f()));
      int i5 = i3;
      do
      {
        do
        {
          if (i5 >= i4) {
            break;
          }
          d locald = localq.a((a.c.e)localList.get(i5 - i1), (a.c.e)((List)localObject6).get(i5 - i2));
          if (i6 != 0) {
            break label1312;
          }
          if (bool) {
            break label1309;
          }
          if (i6 == 0)
          {
            if (this.G != null)
            {
              if (i6 != 0) {
                break label1198;
              }
              if (this.G.getBool(localObject2))
              {
                a(locald, 1.0D);
                if (i6 != 0) {
                  continue;
                }
                if (!bool) {
                  break label1267;
                }
              }
            }
            if (i6 != 0) {
              break label1259;
            }
          }
          if (this.F != null) {
            if (i6 == 0)
            {
              if (!this.F.getBool(localObject2))
              {
                if (i6 != 0) {
                  break label1259;
                }
                if (!this.F.getBool(localObject3)) {}
              }
              else
              {
                a(locald, 100.0D);
              }
            }
            else
            {
              if (i6 != 0) {
                continue;
              }
              if (!bool) {
                break label1267;
              }
            }
          }
          a(locald, 10.0D);
          c(locald, (d)localObject2);
          i5++;
        } while (!bool);
        localm1.f();
      } while (i6 != 0);
    } while (!bool);
    if (i6 == 0) {}
    label1309:
    this.u.e();
    label1312:
    paramab.remove(paramd);
  }
  
  protected void a(a.f.j.n paramn, a.c.e parame)
  {
    this.z.a(paramn, parame);
  }
  
  protected a.c.e c(a.f.j.n paramn)
  {
    return (a.c.e)this.z.get(paramn);
  }
  
  protected d s(d paramd)
  {
    return (d)this.A.get(paramd);
  }
  
  protected void c(d paramd1, d paramd2)
  {
    this.A.a(paramd1, paramd2);
  }
  
  public void a(double paramDouble)
  {
    int i = e.i;
    boolean bool = e.h;
    do
    {
      m localm = a().w();
      while (!bool)
      {
        if (!localm.e()) {
          break;
        }
        this.w.a(localm.a(), paramDouble);
        localm.f();
      }
    } while (i != 0);
  }
  
  protected a.c.n s()
  {
    return this.w;
  }
  
  protected double t(d paramd)
  {
    return this.w.getDouble(paramd);
  }
  
  protected void a(d paramd, double paramDouble)
  {
    this.w.a(paramd, paramDouble);
  }
  
  protected void a(a.c.e parame, Object paramObject)
  {
    this.D.a(parame, paramObject);
  }
  
  protected Object k(a.c.e parame)
  {
    return this.D.get(parame);
  }
  
  protected int d(a.f.j.n paramn)
  {
    return this.y.getInt(paramn);
  }
  
  protected int l(a.c.e parame)
  {
    return this.t.getInt(parame);
  }
  
  private List e(a.f.j.n paramn)
  {
    return (List)this.x.get(paramn);
  }
  
  private void a(a.f.j.n paramn, List paramList)
  {
    this.x.a(paramn, paramList);
  }
  
  protected List u(d paramd)
  {
    int i = e.i;
    a.f.j.n localn = this.u.c(paramd);
    List localList = e(localn);
    if (i == 0) {
      if (localList == null)
      {
        if (i == 0) {
          if (this.E.a(paramd) == 1)
          {
            if (i != 0) {
              break label68;
            }
            localList = this.B;
            if (!e.h) {
              return localList;
            }
          }
        }
        localList = this.C;
      }
    }
    label68:
    return localList;
  }
  
  protected List t()
  {
    return this.B;
  }
  
  protected List u()
  {
    return this.C;
  }
  
  protected boolean a(List paramList)
  {
    int i = e.i;
    if (i == 0) {
      if (!paramList.equals(this.B)) {
        if (i != 0) {
          break label35;
        }
      }
    }
    label35:
    return paramList.equals(this.C);
  }
  
  protected List b(List paramList)
  {
    int i = e.i;
    if (i == 0) {
      if (paramList.equals(this.B)) {
        return this.C;
      }
    }
    if ((i != 0) || (paramList.equals(this.C))) {
      return this.B;
    }
    throw new RuntimeException("given vector equals neither the left nor the right outer face vector!");
  }
  
  int a(x paramx)
  {
    int k = e.i;
    boolean bool = e.h;
    t local0 = new t()
    {
      public boolean getBool(Object paramAnonymousObject)
      {
        if (e.i == 0) {}
        return n.this.E.a((d)paramAnonymousObject) == 1;
      }
    };
    bb localbb = i.a(this.v, local0);
    int i = 0;
    w localw1 = localbb.l();
    do
    {
      do
      {
        if (!localw1.e()) {
          break;
        }
        paramx.a(localw1.d(), -1);
        localw1.f();
        if (k != 0) {
          break label101;
        }
        if (bool) {
          break label94;
        }
      } while (!bool);
    } while (k != 0);
    localw1 = localbb.l();
    label94:
    label101:
    do
    {
      if (!localw1.e()) {
        break;
      }
      a.c.e locale = localw1.d();
      if (bool) {
        break label222;
      }
      int j = -1;
      w localw2 = locale.p();
      do
      {
        do
        {
          if (!localw2.e()) {
            break;
          }
          j = Math.max(j, paramx.getInt(localw2.d()));
          localw2.f();
          if (k != 0) {
            break label217;
          }
          if (bool) {
            break label215;
          }
        } while (!bool);
        paramx.a(locale, j + 1);
        i = Math.max(i, j + 1);
      } while (k != 0);
      localw1.f();
    } while (!bool);
    label215:
    label217:
    label222:
    return i;
  }
  
  public void i()
  {
    q localq = super.a();
    this.v.a(this.t);
    localq.a(this.w);
    this.u.a(this.x);
    this.u.a(this.y);
    localq.a(this.A);
    super.i();
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.h.f.a.n

 * JD-Core Version:    0.7.0.1

 */